#include "StdAfx.h"
#include "TabListItem.h"

CTabListItem::CTabListItem(const TCHAR* name, const TCHAR* picture)
  : CSelectorListItem(CLanguage::Get(name))
{
  if (name)
    m_name = name;
  m_picture = CTheme::GetImage(picture);
}

// Drawing
void CTabListItem::Draw(HDC hdc, const RECT& rc) const
{
  DrawBackground(hdc, rc);
  CRect rcItem = rc;
  if (m_picture.IsValid())
  {
    rcItem.left += CTheme::iListItemIndent;
    m_picture.Draw(hdc, rcItem.left, (rcItem.top + rcItem.bottom - m_picture.height) / 2);
    rcItem.left += m_picture.width;
  }
  DrawText(hdc, rcItem, m_text);
}